<?php

namespace mpend\modules\cms\controllers;

use Yii;
use mpend\components\Controller;
use mpend\modules\cms\models\ArticleSearch;

/**
 * 频道栏目资讯列表接口
 * 
 * @author emhome <emhome@163.com>
 * @since 1.0
 */
class ChannelController extends Controller {

    /**
     * @var ArticleSearch 资讯检索模型
     */
    public $modelClass = ArticleSearch::class;

    /**
     * @inheritdoc
     */
    protected function verbs() {
        return [
            '*' => ['GET']
        ];
    }

    /**
     * @inheritdoc
     */
    public function actionIndex($id) {
        /* @var $model ArticleSearch */
        $model = new $this->modelClass;
        $model->channel_id = $id;
        $model->user_id = $this->uid;
        return $model->search();
    }

}
